use egui::{Align2, Margin, Vec2};
use thunderdome::Index;

#[derive(Debug)]
pub struct UiPanelState {
    pub offset: Vec2,
    pub move_item: Option<Index>,
    pub move_gizmo: Option<Align2>,
    pub is_capture: bool,
}

impl Default for UiPanelState {
    fn default() -> Self {
        Self {
            offset: Vec2::ZERO,
            move_item: None,
            move_gizmo: None,
            is_capture: true,
        }
    }
}

impl UiPanelState {
    pub fn get_offset(&self) -> Vec2 {
        self.offset
    }

    pub fn translate(&mut self, delta: Vec2) {
        self.offset += delta;
    }
}
